﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Meqs.Entity
{
    [Serializable]
    public class GlobalTermInfo
    {
        private int _rID;
        private int _globalYear;
        private int _globalTerm;

        public GlobalTermInfo()
        {
        }

        public GlobalTermInfo(int rID, int globalYear, int globalTerm)
        {
            _rID = rID;
            _globalYear = globalYear;
            _globalTerm = globalTerm;
        }

        public int RID
        {
            get { return _rID; }
            set { _rID = value; }
        }

        public int GlobalYear
        {
            get { return _globalYear; }
            set { _globalYear = value; }
        }

        public int GlobalTerm
        {
            get { return _globalTerm; }
            set { _globalTerm = value; }
        }

        public bool Equals(GlobalTermInfo other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return other._rID == _rID;
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (GlobalTermInfo)) return false;
            return Equals((GlobalTermInfo) obj);
        }

        public override int GetHashCode()
        {
            return _rID;
        }
    }
}
